package model;

import java.util.ArrayList;
import java.util.Random;




public class Ind_Proie extends Individu{
	Boolean alive ;
	Boolean estHarcelee;
	Boolean estAtaquee;
	int heureAttack;
	int debutCbt;
	private Action doingAction;
	private ArrayList<Action> ActionList = new ArrayList<Action>();
	private static Random randomSeed = new java.util.Random();

	
	public Ind_Proie(int _jourNaissance,int _X,int _Y,Role _role){
		alive = true;
		jourNaissance = _jourNaissance;
		posX = _X;
		posY = _Y;
		lifeTime = 100+(randomSeed.nextInt(1900));
		poid = (5+randomSeed.nextInt(1800));
		ActionList.add(new Vagabonder(this));
		ActionList.add(new EstHarcele(this));
		doingAction = ActionList.get(0);
		
	}
	
	private void doAction(){
		doingAction.doAction();	
		for(Action a:ActionList){		
			a.updatePriority();			
			if(a.getPriority()>doingAction.getPriority()){
				doingAction = a;
			}
		}
		
	}
	
	public void update() {	
		if(alive){
			doAction();
		
		}
	}
}
